const sm4 = require('miniprogram-sm-crypto').sm4

// 定义密钥
const key = 'X2E10EJTMCTV58VJI76LN050CEBEW5N5'; // SM4 使用 16 字节的密钥

export const encrypt = (plaintext, ext) => {
  return sm4.encrypt(plaintext, key);
}

export const decrypt = (encryptedData, ext) => {
  return sm4.decrypt(encryptedData, key);
}